package com.shoulei.designpattern.singletonPattern;

/**
 * @ClassName:SingletonObject
 * @Descrition:
 * @Author:shoulei
 * @Date:2019/3/31 18:50
 * @Verson:
 */
public class SingletonObject {
    private static SingletonObject instance = new SingletonObject();

    //让构造函数private，则不会被实例化
    private SingletonObject(){}

    public static SingletonObject getInstance(){
        return instance;
    }

    public void showMessage(){
        System.out.println("hello world");
    }
}
